<html>
<head><meta charset="utf-8"><title>RFC Proposal: `TransmuteInto` Bounds · project-safe-transmute · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/index.html">project-safe-transmute</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.3A.20.60TransmuteInto.60.20Bounds.html">RFC Proposal: `TransmuteInto` Bounds</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205742191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal%3A%20%60TransmuteInto%60%20Bounds/near/205742191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.3A.20.60TransmuteInto.60.20Bounds.html#205742191">(Aug 02 2020 at 20:12)</a>:</h4>
<p>This is a <em>really</em> minor design point, but I'm trying to figure out why a certain set of <code>where</code> bounds are causing an issue.</p>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=25a83d8d8e33e9f631a64b53e3c39844">This is the *minimal* initial implementation of the Safe Transmute RFC</a>. (It's <em>so</em> minimal, it doesn't permit transmutations between different types!)</p>
<p>The definition of <code>TransmuteInto</code> begins on line 33:</p>
<div class="codehilite"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">TransmuteInto</span><span class="o">&lt;</span><span class="n">Dst</span>: <span class="o">?</span><span class="nb">Sized</span><span class="p">,</span><span class="w"> </span><span class="n">Neglect</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">()</span><span class="o">&gt;</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="cm">/*Dst: TransmuteFrom&lt;Self, Neglect&gt;,*/</span><span class="w"></span>
<span class="w">    </span><span class="n">Neglect</span>: <span class="nc">UnsafeTransmuteOptions</span><span class="p">,</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="o">..</span><span class="p">.</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>If I uncomment <code>Dst: TransmuteFrom&lt;Self, Neglect&gt;</code>, I get a bunch of compile-errors. I'm very unsure why.</p>



<a name="205742346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal%3A%20%60TransmuteInto%60%20Bounds/near/205742346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.3A.20.60TransmuteInto.60.20Bounds.html#205742346">(Aug 02 2020 at 20:16)</a>:</h4>
<p>If I had to guess, I'd say the problem probably boils down to an <a href="https://github.com/rust-lang/rust/issues/44491">implied bounds</a> issue, unfortunately.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>